/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    color: #333;
    overflow-x: hidden;
}

/* 背景图样式 */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f5f5f5;
}

/* 顶部背景图区域 */
header {
    height: 100px; /* 减小高度 */
    background: url('images/banner-bg.jpg');
    text-align: center;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 书籍标题样式 */
.book-title {
    position: relative;
    z-index: 2;
}

.book-title h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.book-title p {
    font-size: 1rem;
    opacity: 0.9;
}

/* 下载按钮 */
.download-btn {
    background-color: #4b9cd3;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.download-btn:hover {
    background-color: #3a7ba8;
    transform: translateY(-2px);
}

.download-btn img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* 主要内容区布局 */
main {
    display: flex;
    padding: 20px;
}

/* 左侧章节栏 */
.chapter-sidebar {
    width: 38%;
    padding-right: 20px;
}

.chapter-scroll {
    height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* 章节卡片样式 */
.chapter-item {
    margin-bottom: 20px;
    cursor: pointer;
}

.chapter-thumbnail {
    position: relative;
    width: 60%;
    height: 120px; /* 减小高度 */
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s;
}

.chapter-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/* 章节文字遮罩 */
.chapter-overlay {
    padding: 15px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.chapter-overlay h3 {
    color: #2c7bb6;
    margin-bottom: 5px;
}

.chapter-overlay p {
    color: #666;
    font-size: 0.9rem;
}

/* 章节悬停效果 */
.chapter-item:hover .chapter-thumbnail {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.chapter-item:hover img {
    transform: scale(1.05);
}

/* 搜索框 */
.search-right-align {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    width: 100%;
}

.search-box {
    display: flex;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
    background: white;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
}

.search-box button {
    padding: 0 15px;
    background: #4b9cd3;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}
.button-link {
    display: block; /* 确保整个标题都是可点击的 */
    background-color: #4b9cd3;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    margin-bottom: 15px; /* 与下方内容分隔 */
}
.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.preview-item-content {
    flex: 1;
}

.copy-btn {
    margin-left: 10px;
    background-color: #f1c40f;
    color: #333;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
/*.copy-btn {
    background-color: #f1c40f; /* 可以选择一个适合的颜色 */
/*    color: #333;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
/*}
/* 右侧内容区 */
.content-main {
    width: 62%;
    padding-left: 20px;
}

.content-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: #2c7bb6;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
}

/* 预览项样式 */
.preview-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
}

.preview-item:last-child {
    border-bottom: none;
}

/* 代码块样式 */
pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

/* 查看更多链接 */
.see-more {
    color: #4b9cd3;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 右下角悬浮论坛入口 */
.forum-float {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 100;
}

.forum-float a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.forum-float img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.forum-float span {
    margin-top: 5px;
    color: #333;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .chapter-sidebar,
    .content-main {
        width: 100%;
        padding: 0;
    }
    
    .chapter-thumbnail {
        height: 120px;
    }
}
